//
//  SingRecommendCollectionViewCell.m
//  Music
//
//  Created by dllo on 16/6/7.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "SingRecommendCollectionViewCell.h"

@implementation SingRecommendCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.image = [[UIImageView  alloc] init];
        [self.contentView  addSubview:_image];
        
        self.name = [[UILabel  alloc] init];
        self.name.font =[UIFont  fontWithName:@"Helvetica-Oblique" size:14];
        self.name.textColor = [UIColor  whiteColor];
        [self.contentView  addSubview:_name];
        
        self.desc = [[UILabel  alloc] init];
        self.desc.textColor = [UIColor  whiteColor];
        self.desc.font =[UIFont  fontWithName:@"Helvetica-Oblique" size:12];
        [self.contentView  addSubview:_desc];
    }
    
    return self;
}
-(void)layoutSubviews
{
    [super  layoutSubviews];
    self.name.frame = CGRectMake(8, 8, 100, 30);
    self.desc.frame = CGRectMake(self.name.frame.origin.x, self.name.frame.origin.y+self.name.frame.size.height+5, self.name.frame.size.width+50, 20);
    self.image.frame = CGRectMake(self.desc.frame.origin.x+self.desc.frame.size.width-50, self.name.frame.origin.y+self.name.frame.size.height-20, 30, 30);
    
    
}
-(void)setModel:(smallModel *)model
{
    if (_model != model) {
        _model = model;
    }
    self.image.image = [[UIImage  imageNamed:@"small播放"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    self.name.text = model.name;
    self.desc.text = model.desc;
    
}












@end
